{yun:}include file="$comstyle/header.htm"{/yun}
{yun:}include file="$tplstyle/public_search/index_search.htm"{/yun}
<div class="w1000">
	<div class="admin_mainbody">
	{yun:}include file="$comstyle/left.htm"{/yun}
 	<script src="{yun:}$config.sy_weburl{/yun}/data/plus/job.cache.js?v={yun:}$config.cachecode{/yun}" type="text/javascript"></script>
	<link rel="stylesheet" href="{yun:}$style{/yun}/style/newclass.public.css?v={yun:}$config.cachecode{/yun}" type="text/css">
	<script src="{yun:}$config.sy_weburl{/yun}/js/newclass.public.js?v={yun:}$config.cachecode{/yun}" type="text/javascript"></script> 
	<script src="{yun:}$config.sy_weburl{/yun}/js/lssave.js?v={yun:}$config.cachecode{/yun}" type="text/javascript"></script> 
    <script language="javascript">
	var saveid=$("#id").val();
	var start = 30;
	var step = -1;
	if(!saveid){
		function count(){
			$("#atime").click(function(){ start=30});
			document.getElementById("totalSecond").innerHTML = start;
			start += step;
			if(start < 0 ){
				savejobform();
				start = 30;
			}
			setTimeout("count()",1000);
		}
		window.onload = count;	
	}
	
	function toDate(str){
		var sd=str.split("-");
		return new Date(sd[0],sd[1],sd[2]);
	}
	
function CheckPost(){
 	if($.trim($("#employename").val())==''){layer.msg('员工名字不能为空！',2,8);return false;}
 	if($.trim($("#employemobile").val())!==''){
 		var telphone = $("#employemobile").val();
 		var reg = /^[1][3456789]\d{9}$/; 
        if(!reg.test(telphone)){
           layer.msg('请输入正确的员工手机号！',2,8);
 			return false;
        }
 		
 	}else{
 		layer.msg('请输入员工手机号！',2,8);
 			return false;
 	}
 	if($("#employesex").val()==''){layer.msg('员工性别不能为空！',2,8);return false;}
	if($("#position_status").val()==''){layer.msg('在职状态不能为空！', 2, 8);return false;}
	var index = layer.load('执行中，请稍候...',0);
} 
// function choice(id,type){
// 	if(type=='link'||type=='email'){
// 		if(id==1){
// 			$("#is"+type+"3").removeClass('admin_job_style_n');
// 			$("#is"+type+"2").removeClass('admin_job_style_n');
// 			$("#is"+type+id).addClass('admin_job_style_n');
// 			$("input[name='is"+type+"']").val(id);
// 			$("#new"+type).hide();
// 			$("#tblink").val(2)
// 		}else if(id==2){
// 			$("#is"+type+"3").removeClass('admin_job_style_n');
// 			$("#is"+type+"1").removeClass('admin_job_style_n');
// 			$("#is"+type+id).addClass('admin_job_style_n');
// 			$("input[name='is"+type+"']").val(id);
// 			$("#new"+type).show();
// 		}else if(id==3){
// 			$("#is"+type+"1").removeClass('admin_job_style_n');
// 			$("#is"+type+"2").removeClass('admin_job_style_n');
// 			$("#is"+type+id).addClass('admin_job_style_n');
// 			$("input[name='is"+type+"']").val(id);
// 			$("#new"+type).hide();
// 		}
// 	}
// }
function returnmessagejob(frame_id){ 
	if(frame_id==''||frame_id==undefined){
		frame_id='supportiframe';
	}
	var message = $(window.frames[frame_id].document).find("#layer_msg").val(); 
	if(message != null){
		var url=$(window.frames[frame_id].document).find("#layer_url").val();
		var layer_time=$(window.frames[frame_id].document).find("#layer_time").val();
		var layer_st=$(window.frames[frame_id].document).find("#layer_st").val();
		var layer_url = $(window.frames[frame_id].document).find("#layer_url").val();
		layer.closeAll('loading');
		if(layer_st=='9'){
			
			$('#jobid').val(layer_url);
				$.layer({
					type : 1,
					move:false,
					fix: true,
					zIndex:666,
					title : '系统提示', 
					border : [10 , 0.3 , '#000', true],
					area : ['480px','330px'],
					page : {dom : '#addjob'},
					close: function(){
						{yun:}if $config.com_job_status=='1'{/yun}
						window.location.href = "index.php?c=job&w=1";
						{yun:}else{/yun}
						window.location.href = "index.php?c=job&w=0";
						{yun:}/if{/yun}
					}
				});
		}else{
			if(url=='1'){
				layer.msg(message, layer_time, Number(layer_st),function(){window.location.reload();window.event.returnValue = false;return false;});
			}else if(url==''){

				layer.msg(message, layer_time, Number(layer_st));
			}else{
				layer.msg(message, layer_time, Number(layer_st),function(){window.location.href = url;window.event.returnValue = false;return false;});
			}
		} 
	}
}


</script>
<input type="hidden" id="comname" value="{yun:}$company.name{/yun}">
    <div class=right_box>
      	<div class=admincont_box>
           	<div class="com_tit"><span class="com_tit_span">新增员工</span></div>  
            <div class="com_body">

        		<iframe id="supportiframejob"  name="supportiframejob" onload="returnmessagejob('supportiframejob');" style="display:none"></iframe>
        		<form name="MyForm" target="supportiframejob" method="post" action="index.php?c=employeadd&act=save" onsubmit="return CheckPost();" class="layui-form">

	           		<div class="com_release_box">
						<ul>
							<li>
								<div class="com_release_name"><i class="ff0">*</i> 员工名字</div>
								<div class="com_release_cont">
						            <div class="com_release_cont_text">
										<input type="text" size="45" lay-verify="required" name="employe_name" id='employename' value="{yun:}$row.employe_name{/yun}" class="layui-input">
					                </div>
				  					<span id="by_name" class="errordisplay">员工名字不能为空</span> 
				  				</div>
				            </li>
				            <li>
								<div class="com_release_name"><i class="ff0">*</i> 员工手机</div>
								<div class="com_release_cont">
						            <div class="com_release_cont_text">
										<input type="text" size="45" lay-verify="required" name="employe_mobile" id='employemobile' value="{yun:}$row.employe_mobile{/yun}" class="layui-input">
					                </div>
				  					<span id="by_name" class="errordisplay">员工手机不能为空</span> 
				  				</div>
				            </li>
				            <li>
					            <div class="com_release_name">员工性别</div>
					            <div class="com_release_cont">
									<div class="layui-input-inline">
										<select name="employe_sex" lay-filter="employesex">
										  <option value="1" {yun:}if $row.employe_sex == 1{/yun} selected{yun:}/if{/yun}>男</option>
										  <option value="2" {yun:}if $row.employe_sex == 2{/yun} selected{yun:}/if{/yun}>女</option>
										</select>
									</div>
					            </div>
					        </li>
					        <li>
					            <div class="com_release_name">在职状态</div>
					            <div class="com_release_cont">
									<div class="layui-input-inline">
										<select name="position_status" lay-filter="position_status">
										  <option value="1" {yun:}if $row.position_status == 1{/yun} selected{yun:}/if{/yun}>在职</option>
										  <option value="2" {yun:}if $row.position_status == 2{/yun} selected{yun:}/if{/yun}>离职</option>
										</select>
									</div>
					            </div>
					        </li>
			            </ul>
			        </div>

	           		<div class="clear"></div>
	          		<div class=admin_submit>
	                	<div class="admin_job_js_list_ft fl"><span style="width:100%;">&nbsp;</span></div>
				        <div class=sub_btn>
							<input type="hidden" id="logid" name="logid">
				              <input class="btn_01"  id="submitBtn"type="submit" name="submitBtn" value=" 提 交 操 作 ">
				              <input name="jobcopy" value="{yun:}$smarty.get.jobcopy{/yun}" type="hidden"/>
				           {yun:}if $smarty.get.id{/yun}
				            <input id="id"name="id" value="{yun:}$row.id{/yun}" type="hidden"/>
				            {yun:}/if{/yun}
				            <input name="state" value="{yun:}$row.state{/yun}" type="hidden"/>
				             <input id="save"name="save" value="{yun:}$row.name{/yun}" type="hidden"/>
				        </div> 
				        <div class="clear"></div>
					</div>
        		</form>
     
    		</div>  
    	</div>

    </div>
 
  </div>
</div>  

	{yun:}if !$smarty.get.id{/yun}
    <div class="text_tips_bc">
	   	<div class="text_tips_bc_h1"> 保存临时信息</div>
	   	<div class="text_tips_bc_cont"> 
		     {yun:}if $save.time{/yun}
		     <div class="text_tips_bc_l">信息已于{yun:}$save.time{/yun}保存</div>
		     {yun:}/if{/yun}
	    	<div> 
			    <div class="text_tips_bc_r">
			    	<div class="text_tips_bc_time"> 
			    		<div class="text_tips_bc_time_c">  
			    			<span class="text_tips_bc_time_n" id="totalSecond"></span>s
			    		</div>后将自动保存已填信息
			    	</div>
			    	<a id="atime"href="javascript:;" onclick="savejobform();" class="text_tips_bc_bth">临时保存</a>
			    </div>
     		</div>
    	</div>
    </div>
    {yun:}/if{/yun}

	<input type='hidden' id='jobid' value=''>
	<div class="job_tck_box" id="addjob" style="display:none;">
		<div class="job_box_div" style="width:440px;"> 
	        <div class="jonadd_prompt_icon"></div>
			<div class="jonadd_prompt">
	     <div class="jonadd_prompt_p"><span id="returnmsg" class="job_add_success">员工添加成功！</span></div>
	        
	        <a href="javascript:void(0)"  onclick="employe_url();return false;" class="job_add_continue">继续添加员工</a>
	        </div>
	        
	        <div class="jonadd_prompt_img" id="qrcodeimg">
				<img src='{yun:}$config.sy_weburl{/yun}/{yun:}$config.sy_wx_qcode{/yun}'  width='80' height='80'>
	            <div class="jonadd_prompt_img_p">微信公众号</div>
	        </div>
	        
	         <div class="jonadd_prompt_share">让企业品牌更红，让招聘效果更高，立即分享转发招聘职位吧</div>
	        <div class="jonadd_prompt_share_opt" id="share" style="height:50px;"></div>
		</div>
		
	</div>
<script language=javascript src='{yun:}$config.sy_weburl{/yun}/data/plus/city.cache.js?v={yun:}$config.cachecode{/yun}'></script>
<script language=javascript src='{yun:}$config.sy_weburl{/yun}/js/city.js?v={yun:}$config.cachecode{/yun}'></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.config.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.all.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script>
layui.use(['form', 'layer', 'laydate'], function(){
    var form = layui.form,
		layer = layui.layer,
		laydate = layui.laydate,
		$ = layui.$;  

	form.on('select(moneytype)', function(data){
      if(data.value == 1){
        $("#money_1").show();
        $("#money_2").hide();
      }else{
        $("#money_2").show();
        $("#money_1").hide();
      }
    });
 
	form.on('switch(type_switch)', function(data){
      var v = this.checked ? 1 : 2;
      $("#tblink").val(v);
    });

 	form.on('checkbox(salary_type)', function(data){
		if(data.elem.checked){
			$("#minsalary").attr("disabled","disabled");
			$("#maxsalary").attr("disabled","disabled");
			$("#minsalary").val(0);
			$("#maxsalary").val(0);
		}else if(!data.elem.checked){
			$("#minsalary").removeAttr("disabled","disabled");
			$("#maxsalary").removeAttr("disabled","disabled");
			$("#minsalary").val('{yun:}$row.minsalary{/yun}');
			$("#maxsalary").val('{yun:}$row.maxsalary{/yun}');
		}
    });

  });

	function addjob_continue(uid,integral_job){
		var gourl='index.php?c=jobadd';
		var url = weburl + '/index.php?m=ajax&c=ajax_day_action_check';
		$.post(url,
			{'type': 'addjob'},
			function(data){
				data = eval('(' + data + ')');
				if(data.status == -1){
					layer.msg(data.msg, 2, 8);
				}else if(data.status == 1){
					
					var addurl = 'index.php?c=jobadd&act=getJobNum';
					$.post(addurl,{uid:uid},function(data1){
 
 						if(data1 == 1 || (integral_job==0 && data1!=0)){
							window.location.href=gourl;
							window.event.returnValue = false;
							return false;
						}else if(data1 == 2){
							var msg='套餐已用完，继续操作将会消费'+integral_job+'元，您还可以<a href="index.php?c=right&act=added" style="color:red">购买增值包</a>，是否继续？';
							layer.confirm(msg, function(){
 								var height="300px";
 								$.layer({	
									type : 1,
									title : '发布职位',
									closeBtn : [0 , true],
									border : [10 , 0.3 , '#000', true],
									area : ['480px',height],
									page : {dom : '#issue_job'}
								});
 							});

						}else if(data1==0){
							var msg='会员已到期，您可以<a href="index.php?c=right" style="color:red">购买会员</a>，是否继续？';

							layer.confirm(msg, function(){
								window.location.href="index.php?c=right"; 
							});  
							
						}
					});
				}
			}
		);
	}
	var editor = UE.getEditor('description',{
		toolbars:[[ 'Source','|', 'Undo', 'Redo','Bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'fontfamily', 'fontsize',  'forecolor', 'backcolor', 'removeformat', 'autotypeset', 'pasteplain', '|','insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|','simpleupload', '|','link', 'unlink', 'indent', '|','justifyleft', 'justifycenter', 'justifyright', 'justifyjustify']],wordCount:false,elementPathEnabled:false,initialFrameHeight:200
	});

 	var second = 0;
	window.setInterval(function () {
		second ++;
	}, 1000);

	var url     = location.href, 
		refer   = document.referrer, 
		timeIn  = Math.ceil(new Date().getTime()/1000); 
	{yun:}if $smarty.get.id{/yun}
		var opera=32;
	{yun:}else{/yun}
		var opera=31;
	{yun:}/if{/yun}
	$(function(){
		setTimeout(function(){ 
			$.post('index.php?c=log',{url:url,refer:refer,timeIn:timeIn,second:2,opera:opera},function(data){
				if(data){
					$("#logid").val(data);
				}
			})
		},2000);
		
    }) 
	
	window.onbeforeunload = function(){
		var logid = $("#logid").val();
 		if(second>2){ 
			$.post('index.php?c=log&act=gxLog',{id:logid,second:second},function(data){
				if(data) {
					return false;
				}
			})
		}
   	}
</script>

{yun:}include file="$comstyle/jobserver.htm"{/yun}
{yun:}include file="$comstyle/footer.htm"{/yun}